import requst from '../../../util/Http.js'
Page({
    data: {
        category: [],
        list:{},
        curIndex: 0,
        isScroll: false,
        toView: 'guowei'
    },
    onLoad(){
      let than=this;
        //  获取主题详情
        requst('Index/getcalssList',{count:2},'post').then(res=>{
          than.setData({
            category:res.data,
          })
          requst('Index/getcalssitemList',{id:res.data[0].id},'post').then(ress=>{
            than.setData({
              list:ress.data
            })
          })
        })
       
        
    },
    switchTab(e){
      let than=this;
        this.setData({
            toView : e.target.dataset.id,
            curIndex : e.target.dataset.index,
        })
        requst('Index/getcalssitemList',{id:e.target.dataset.id},'post').then(res=>{
          than.setData({
            list:res.data
          })
        })
    }
  
    
})